home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / Tutorial / Cookbook / 41.PieChart / PieChartView.h < prev    next >
Text File  |  1995-06-12  |  1KB  |  50 lines

  1. #import <appkit/View.h>
  2.  
  3. #define MAX_CHARS_PER_FONT_NAME 100
  4. #define MAX_CHARS_PER_WEDGE_LABEL 100
  5. #define MAX_WEDGES 100
  6.  
  7. @interface PieChartView:View
  8. {
  9.     // ids for outlets
  10.     id numWedgesText;
  11.     id pieSizeText;
  12.     id labelLineLengthText;
  13.     id pieFontText;
  14.     //
  15.     id fontID;
  16.     float pieSize;     // holds the size of the chart (in ps coords)
  17.     float pieFontSize; // holds the font size
  18.     char pieFont[MAX_CHARS_PER_FONT_NAME];  // holds the font name
  19.     int numWedges;     // holds the number of wedges to be drawn
  20.     float wedgeValue[MAX_WEDGES];   // holds the data
  21.     float grays[MAX_WEDGES];   // holds the gray shade for each wedge
  22.     float normData[MAX_WEDGES];   // holds the data normalized so that the sum is 360
  23.     char labels[MAX_WEDGES][MAX_CHARS_PER_WEDGE_LABEL];   // holds the labels
  24. }
  25.  
  26. // action methods for use with Interface Builder
  27. -takeValueFromMatrix:sender;
  28. -takeLabelFromMatrix:sender;
  29. -takeGraysFromMatrix:sender;
  30. -takePieSizeFrom:sender;
  31. -takeFontSizeFrom:sender;
  32. -takeNumWedgesFrom:sender;
  33.  
  34. // outlets
  35. -setNumWedges:anObject;
  36. -setPieSizeText:anObject;
  37. -setLabelLineLengthText:anObject;
  38. -setPieFontText:anObject;
  39.  
  40. // Objective C methods
  41. -setPieSize: (float) size;
  42. -setPieFontSize: (float) size;
  43. -setPieFont: (char *) fontName;
  44. -addPieWedge: (float)value: (char *)label: (float)gray;
  45. -removePieWedge: (int)index;
  46. -setPieWedge: (int)wedgeNumber: (float)value: (char *)label: (float)gray;
  47. -normalize;
  48.  
  49. @end
  50.